<?php
require_once 'ftpinfo.php';
function moveToFtp($files=array())
{
	if(empty($files)) return;
	$ftp = Wdk::helper('Ftp');
	$ftp->login(FILE_HOST, FILE_USER, FILE_PWD);
	foreach($files as $file)
	{
		$local = str_replace('//','/',BASE_PATH.$file);
		$remote = dirname(FILE_PATH.$file);
		$ftp->put($local, $remote);
		@unlink($local);
	}
	$ftp->end();
}
function removeFromFtp($files=array())
{
	if(empty($files)) return;
	$ftp = Wdk::helper('Ftp');
	$ftp->login(FILE_HOST, FILE_USER, FILE_PWD);
	$files = array_unique($files);
	foreach($files as $file)
	{
		if($file != '')
		$ftp->remove(FILE_PATH.$file);
	}
	$ftp->end();
}